#pragma once
#include <Arduino.h>

const String indexx = R"rawliteral(<!DOCTYPE HTML> <html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
"<meta name='viewport' content='width=device-width,initial-scale=1,user-scalable=no'/>"
<title>ESP8266 drv8833 drive motor</title>
<style>html { font-family: Helvetica; display: inline-block;margin: 0px auto; text-align: center;}
body{margin-top: 20px;} h1 {color: #444444;margin: 50px auto 30px;}
h3 {color: #444444;margin-bottom: 50px;}
.controls { display: flex; flex-direction: column; align-items: center;}
button { width: 150px; height: 50px; margin: 10px;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%}
.controls > div { display: flex; justify-content: center; width: 70%; margin: 10px;}
</style></head><body><h1>Motor Control</h1>
<div class="controls">
<select id="select_pin"> <option value="p0" selected>0</option>
  <option value="p1">1</option> <option value="p2">2</option> <option value="p3">3</option>
  <option value="p4">4</option> <option value="p5">5</option> <option value="p6">6</option>
  <option value="p7">7</option> <option value="p8">8</option> <option value="p9">9</option>
  <option value="p10">10</option>
</select>
<h1>以下按钮可控制ESP8266开发板引脚</h1>
<div> <button type="button" onclick="sendData(1)">点亮 LED</button>
<button type="button" onclick="sendData(0)">关闭 LED</button> </div>
</div>
<div>LED引脚状态 : <span id="LEDState">NA</span>
</div><h1>以下为模拟输入引脚A0的实时读数</h1>
<div>A0引脚读数 : <span id="ADCValue">0</span></div>
<script>
function sendData(led) {
var pin = document.getElementById("select_pin");
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
  document.getElementById("LEDState").innerHTML = this.responseText;
}};
xhttp.open("GET", "setLED?LEDstate="+led+"&pin="+pin, true);
xhttp.send();
}

setInterval(function() {
  // Call a function repetatively with 2 Second interval
  getData();
}, 2000); //2000mSeconds update rate

function getData() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      document.getElementById("ADCValue").innerHTML =
      this.responseText;
    }
  };
  xhttp.open("GET", "readADC", true);
  xhttp.send();
}
</script></body></html>
)rawliteral";